/*********************** Exercise 4 ************************
 *  Write a program that calculates velocity using
 * a constant distance and a constant time.
 *
 ***********************************************************/

package operators;

import static utils.Print.*;

/**
 * @author Vlad
 */
public class Exercise4 {
    public static float speed(float distance, float time){
        if(time == 0F){
            return -1F;
        }
        return distance / time;
    }

    public static void main(String [] args){
        float distance = 10.0F;
        float time = 2F;
        print("distance = " + distance);
        print("time = " + time);
        print("speed = " + speed(distance, time));
    }
}
